//
//  TittleCell.m
//  Everest
//
//  Created by 李其昌 on 14/12/22.
//  Copyright (c) 2014年 ThreeL. All rights reserved.
//

#import "TittleCell.h"

@implementation TittleCell

- (void)dealloc
{
    [_myButton release];
    [_myImageView release];
    [_myLabel release];
    [super dealloc];
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.myImageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.myImageView];
        [_myImageView release];
        self.myLabel = [[UILabel alloc] init];
        self.myLabel.userInteractionEnabled = YES;
        self.myLabel.textAlignment = NSTextAlignmentLeft;
        [self.contentView addSubview:self.myLabel];
        [_myLabel release];
        self.myButton = [[UIButton alloc] init];
        [self.myButton setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
        [self.myButton setTitleColor:[UIColor lightGrayColor] forState:UIControlStateHighlighted];
        [self.contentView addSubview:self.myButton];
        [_myButton release];
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.myImageView.frame = CGRectMake(10, 15, 20, 20);
    self.myLabel.frame = CGRectMake(30, 0, [UIApplication sharedApplication].keyWindow.bounds.size.width / 4 * 3 - 30,self.contentView.bounds.size.height);
    self.myButton.frame = CGRectMake([UIApplication sharedApplication].keyWindow.bounds.size.width / 4 * 3, 0, [UIApplication sharedApplication].keyWindow.bounds.size.width / 4, self.contentView.bounds.size.height);
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
